#pragma strict
@script ExecuteInEditMode

var cam:Camera;

var text:String = "abc123";

var skin:GUISkin;
var style:GUIStyle;

function Start () {
	
}

var rect:Rect = Rect(0,0,100,100);

function Update(){
	var pos:Vector3 = cam.WorldToScreenPoint(transform.position);
	rect.x = pos.x;
	rect.y = pos.y;
}

function OnGUI(){
	GUI.skin = skin;
	GUILayout.BeginArea(rect);
	GUILayout.Label(text,style,GUILayout.Width(rect.width),GUILayout.Height(rect.height));
	GUILayout.EndArea();
}
